import request from '@/utils/request'

/**
 *
 * @param {*} data {mobile,password}
 * @returns
 */
// 获取公司部门
export function getDepartments(data) {
  return request({
    url: '/company/department',
    method: 'get',
    data
  })
}
// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 根据id查询部门详情
export function getOneDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
// 根据id修改部门数据
export function setDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// 根据id删除部门数据
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
